<script>
	import {
		mapGetters,
		mapActions
	} from 'vuex';
	export default {
		globalData: {
			statusBarHeight: 0, //状态栏的高度
			navigationBarHeight: 0, //导航栏(标题栏)高度
			navHeight: 0, //导航栏的总高度（标题栏+状态栏）
			capsuleHeight: 0, //胶囊的高度
			capsuleLeft: 0, //胶囊的左边距离
			windowHeight: 0, //页面可用高度
			store: null
		},
		computed: {
			...mapGetters({
				isTokenValid: 'user/isTokenValid'
			})
		},
		methods: {
			...mapActions({
				init: 'app/init'
			})
		},
		onLaunch: function() {
			const { statusBarHeight, platform, windowHeight } = uni.getSystemInfoSync();
			const { top, height, left } = uni.getMenuButtonBoundingClientRect();
			this.globalData.statusBarHeight = statusBarHeight;
			this.globalData.navigationBarHeight = (top && height) ? ((top - statusBarHeight) * 2 + height) : platform === 'android' ? 48 : 40;
			this.globalData.navHeight = this.globalData.navigationBarHeight + this.globalData.statusBarHeight;
			this.globalData.capsuleHeight = height;
			this.globalData.capsuleLeft = left;
			this.globalData.windowHeight = windowHeight;
			this.globalData.store = this.$store;
			if (this.isTokenValid) this.init();
			// console.log('token', '获取的token');
			// console.log('tokenExpired', Date.now() + 24 * 60 * 60 * 1000 * 10);
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>
<style>
	view,
	navigator {
		box-sizing: border-box;
	}
	@font-face {
		font-family: 'iconfont';
		src: url(@/static/iconfont.ttf);
	}
	.iconfont {
		font-family: "iconfont" !important;
	}
	.icon {
		display: flex;
		align-items: center;
		font-size: 32rpx;
	}
	.btnClickStyle {
		opacity: 0.9;
	}
	.placeholderStyle {
		font-size: 28rpx;
		color: #7B8079;
	}
	button::after {
		border: none !important;
	}
	.uni-noticebar {
		padding: 10rpx 30rpx !important;
	}
	.blur {
		position: relative;
		filter: blur(5px);
		user-select: none;
	}
	.blur::after {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		content: '';
		display: block;
		background: rgba(255, 253, 253, 0);
	}
</style>
